package com.example.training.service;

import com.example.training.model.entity.Student;

import java.util.List;
import java.util.Map;

public interface StudentService {
    /**
     * @Author huaginlin
     * @Description 1. Group by 'sex' attribute into a Map      
     * @date 11:55 2025/5/15
     * @Param []
     * @Return java.util.Map<java.lang.String,java.util.List<com.example.training.model.entity.Student>>
     **/
    Map<String, List<Student>> groupStudentsBySex();

    /**
     * @Author huaginlin
     * @Description 2. Group by 'FirstLetter' attribute into a Map      
     * @date 11:56 2025/5/15
     * @Param []
     * @Return java.util.Map<java.lang.String,java.util.List<com.example.training.model.entity.Student>>
     **/
    Map<String, List<Student>> groupStudentsByFirstLetter();

    /**
     * @Author huaginlin
     * @Description 3. Get all distinct student names      
     * @date 11:56 2025/5/15
     * @Param []
     * @Return java.util.List<java.lang.String>
     **/
    List<String> getDistinctNames();

    /**
     * @Author huaginlin
     * @Description 4. Group students by name length      
     * @date 11:56 2025/5/15
     * @Param []
     * @Return java.util.Map<java.lang.Integer,java.util.List<com.example.training.model.entity.Student>>
     **/
    Map<Integer, List<Student>> groupStudentsByNameLength();

    /**
     * @Author huaginlin
     * @Description 5. Sort students (ascending or descending order)      
     * @date 11:57 2025/5/15
     * @Param [desc]
     * @Return java.util.List<com.example.training.model.entity.Student>
     **/
    List<Student> getSortedStudents(int desc);

    /**
     * @Author huaginlin
     * @Description 6. Get all distinct hometowns concatenated with commas      
     * @date 11:57 2025/5/15
     * @Param []
     * @Return java.lang.String
     **/
    String getDistinctHometowns();

    /**
     * @Author huaginlin
     * @Description 7. Add new student      
     * @date 11:57 2025/5/15
     * @Param [student]
     * @Return boolean
     **/
    boolean addStudent(Student student);

    /**
     * @Author huaginlin
     * @Description 8. Update student information      
     * @date 11:57 2025/5/15
     * @Param [id, student]
     * @Return java.util.List<com.example.training.model.entity.Student>
     **/
    List<Student> updateStudents(int id, Student student);

    /**
     * @Author huaginlin
     * @Description 9. Remove student by specific ID      
     * @date 11:57 2025/5/15
     * @Param [id]
     * @Return java.util.List<com.example.training.model.entity.Student>
     **/
    List<Student> removeStudentsById(int id);

    /**
     * @Author huaginlin
     * @Description Get all students      
     * @date 11:57 2025/5/15
     * @Param []
     * @Return java.util.List<com.example.training.model.entity.Student>
     **/
    List<Student> getAllStudents();
}